<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>钱狐</title>
    <script type="text/javascript" src="<%=path %>/static/js/jquery.js"></script>
    <script type="text/javascript" src="<%=path %>/static/layer/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="css/css.css?v=1" />
    <style>
       ::-webkit-input-placeholder { /* WebKit browsers */
       　　color:#e98226;
       }
       :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
       　　color:#e98226;
       }
       ::-moz-placeholder { /* Mozilla Firefox 19+ */
       　　color:#e98226;
       }
       :-ms-input-placeholder { /* Internet Explorer 10+ */
       　　color:#e98226;
       }
    </style>
</head>
<body style="background:url(images/inviter_reg_bg.jpg) no-repeat;background-size:100% 100%;">
   <form id="form1">
      <!--<img src="images/inviter_reg_bg.jpg" class="invite_reg_bg" />-->
      <div class="contrainer">
         <div style="padding-top:200px">
            <input type="text" id="txtMobile" class="input" placeholder="请输入手机号码" />
         </div>

         <div>
            <input class="btn" type="button" id="btnReg" />
         </div>
      </div>
   </form>
   <script>
      $(function(){
         //获取设备高度（软键盘调出来时高度也会变小，所以在点击事件前获取）
         var deviceH=document.documentElement.clientHeight+"px";

         //表单获得焦点后动态改变body和背景图片的大小
         $('#txtMobile').on("click",function(){
            $("body").attr("style","background:url(images/inviter_reg_bg.jpg) no-repeat;width:100%;height:"+deviceH+";background-size: 100% "+deviceH);
         });

         $("#btnReg").click(function(){
            if($("#txtMobile").val()==""){
               layer.msg("请输入手机号！");
               return;
            }
            /*if($("#txtPwd").val()==""){
               layer.msg("请输入密码！");
               return;
            }*/
            $.getJSON("<%=path %>/appapi/appapi.htmls",{fun:"register",inviter:"${param.inviter}",mobile:$("#txtMobile").val()},function(data){
               if(data.state==1){
                  location.href="invite_success.jsp";
               }
               else{
                  layer.msg(data.msg);
               }
            });
         });

      });
   </script>
</body>
</html>
